#ifndef __MEMORYMANAGEMENT_H
#define __MEMORYMANAGEMENT_H

#include <common/types.h>

struct MemoryChunk
{
    MemoryChunk* pre;
    MemoryChunk* next;
    bool allocated;
    size_t size;
};


class MemoryManager{

protected:
    MemoryChunk* first;

public:
    static MemoryManager* activeMemoryManager;
    MemoryManager(size_t first, size_t size);
    ~MemoryManager();

    void* malloc(size_t size);
    
    void free(void* ptr);



};



// void* operator new(size_t size);
// void* operator new[](size_t size);
// void operator delete(void* ptr);
// void operator delete[](void* ptr);


void* operator new(unsigned int size);
void* operator new[](unsigned int size);

//plcaement new
void* operator new(unsigned int size, void* ptr);
void* operator new[](unsigned int size, void *ptr);

void operator delete(void* ptr);
void operator delete[](void* ptr);

#endif